package cn.classTest.mall.domain;

import com.alibaba.fastjson.JSON;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
@Data
public class Warehouse {
    private Long id;
    private String address;
    private String tel;
    private Boolean status = false;
    private Goods goods;
    private Long num;
    private String json;

    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("address", address);
        map.put("tel", tel);
        map.put("status", status);
        map.put("num", num);
//        map.put("goods", goods.getJson());

        return JSON.toJSONString(map);
    }
}
